#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
@Project ：图灵学习 
@File    ：18.使用星号拆包.py
@IDE     ：PyCharm 
@Author  ：ChenLiGao
@Date    ：2024-10-09 09:19
'''


'''
   单星拆包 
'''

def set_list():
    return [1, 2, 3, 4, 5, 6, 7, 8, 9]

res = set_list()

print(*res)


def set_arr(a, b, c):
    print(f"a={a}, b={b}, c={c}")

int_list = [[11,44], 22, 33]

set_arr(*int_list)


'''
    双星拆包
'''
def person_info(name, age, gender):
    print(f'name={name}, age={age}, gender={gender}')

info = {
    'name': '顾安',
    'age': 20,
    'gender': '男'
}

person_info(**info)

'''
    字典的key必须核函数的参数名一致，否则会报错
'''